import request from '@/utils/request'

const restfulBasePath = '/permission'

export function getPermissionsTree() {
  return request({
    url: restfulBasePath + '/list',
    method: 'GET'
  })
}

export function savePermission(data) {
  console.log('方法内', data)
  return request({
    url: restfulBasePath + '/save',
    method: 'POST',
    data: data
  })
}

export function deletePermission(id) {
  return request({
    url: restfulBasePath + '/delete/' + id,
    method: 'POST'
  })
}

export function checkPermission(id) {
  return request({
    url: restfulBasePath + '/checkPermission/' + id,
    method: 'GET'
  })
}

export function getPermission(id) {
  return request({
    url: restfulBasePath + '/get/' + id,
    method: 'GET'
  })
}
